package com.key.service.impl;

import com.key.common.vo.ACSVO;
import com.key.mapper.ACSMapper;
import com.key.service.ACSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author：朕
 * @Package：com.key.service.impl
 * @Project：ams_system
 * @name：ACSServiceImpl
 * @Date：2023/2/24 0:46
 * @Filename：ACSServiceImpl
 */
@Service
public class ACSServiceImpl implements ACSService {

    @Autowired
    private ACSMapper acsMapper;

    /**
     * 显示资产汇总
     * @return
     */
    @Override
    public Map<String,Object> findACS() {
        List<ACSVO> acsvos = acsMapper.findACS();
        List<ACSVO> integers = acsMapper.sumACS();
        Map<String,Object> map =new HashMap<>();
        map.put("msg",acsvos);
        map.put("QuantityAndMoney",integers);
        return map;
    }

    /**
     * 通过公司显示资产分类报表
     * @param company
     * @return
     */
    @Override
    public Map<String,Object> findACSByCompany(String company) {
        List<ACSVO> acsvos = acsMapper.findACSByCompanyName(company);
        List<ACSVO> integers = acsMapper.sumACSByCompanyName(company);
        Map<String,Object> map =new HashMap<>();
        map.put("msg",acsvos);
        map.put("QuantityAndMoney",integers);
        return map;
    }

    /**
     * 通过部门显示资产分类报表
     * @param department
     * @return
     */
    @Override
    public Map<String,Object> findACSByDepartment(String department) {
        List<ACSVO> acsvos = acsMapper.findACSByDepartmentName(department);
        List<ACSVO> integers = acsMapper.sumACSByDepartment(department);
        Map<String,Object> map =new HashMap<>();
        map.put("msg",acsvos);
        map.put("QuantityAndMoney",integers);
        return map;
    }

    /**
     * 通过分类编码显示资产分类报表
     * @return
     */
    @Override
    public List<ACSVO> findACSById(Integer Id) {
        List<ACSVO> acsvos = acsMapper.findACSById(Id);
        return acsvos;
    }
}
